package com.wsc.wsckeeper.model.entity;

import java.util.Date;

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import com.wsc.wsckeeper.model.entity.base.BaseEntityE;

@DatabaseTable(tableName = "card")
public class CardE extends BaseEntityE {

	public static final String FIELD_NUMBER = "number";
	public static final String FIELD_PIN_CODE = "pin";
	public static final String FIELD_OWNER = "owner";
	public static final String FIELD_EXPIRES_END = "expiresEnd";
	public static final String FIELD_CREATED = "created";
	public static final String FIELD_SING = "sing";
	public static final String FIELD_FK_CARD_TYPE = "cardtypeid";
	public static final String FIELD_FK_CURRENCY = "currencyid";

	@DatabaseField(columnName = FIELD_NUMBER, dataType = DataType.STRING)
	private String number;
	@DatabaseField(columnName = FIELD_PIN_CODE, dataType = DataType.STRING)
	private String pin;
	@DatabaseField(columnName = FIELD_OWNER, dataType = DataType.STRING)
	private String owner;
	@DatabaseField(columnName = FIELD_EXPIRES_END, dataType = DataType.DATE)
	private Date expiresEnd;
	@DatabaseField(columnName = FIELD_CREATED, dataType = DataType.DATE)
	private Date created;
	@DatabaseField(columnName = FIELD_SING, dataType = DataType.STRING)
	private String sing;
	@DatabaseField(columnName = FIELD_FK_CARD_TYPE, foreign = true, foreignAutoRefresh = true, canBeNull = false)
	private CardTypeE cardType;
	@DatabaseField(columnName = FIELD_FK_CURRENCY, foreign = true, foreignAutoRefresh = true, canBeNull = false)
	private CurrencyE currency;

	public CardE() {
	}

	public CardE(String number, String pin, String owner, Date expiresEnd, Date created, String sing, CardTypeE cardType, CurrencyE currency, String description) {
		this.number = number;
		this.pin = pin;
		this.owner = owner;
		this.expiresEnd = expiresEnd;
		this.created = created;
		this.sing = sing;
		this.cardType = cardType;
		this.currency = currency;
		this.description = description;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getCode() {
		return pin;
	}

	public void setCode(String code) {
		this.pin = code;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

	public Date getExpiresEnd() {
		return expiresEnd;
	}

	public void setExpiresEnd(Date expiresEnd) {
		this.expiresEnd = expiresEnd;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public String getSing() {
		return sing;
	}

	public void setSing(String sing) {
		this.sing = sing;
	}

	public CardTypeE getCardType() {
		return cardType;
	}

	public void setCardType(CardTypeE cardType) {
		this.cardType = cardType;
	}

	public String getPin() {
		return pin;
	}

	public void setPin(String pin) {
		this.pin = pin;
	}

	public CurrencyE getCurrency() {
		return currency;
	}

	public void setCurrency(CurrencyE currency) {
		this.currency = currency;
	}

}
